package com.demo2do.fms.entity.driver;

import com.demo2do.core.utils.Alias;

/**
 * 司机审核状态：编辑中、待审核、驳回、合格
 *
 * @author Ark
 *
 */
@Alias("DriverAuditStatus")
public enum DriverAuditStatus {

    EDITING("editing", "编辑中"),

    AUDIT("audit", "待审核"),

    REJECTED("rejected", "驳回"),

    QUALIFIED("qualified", "合格");
    
    private String alias;
    
    private String description;

    /**
     * @param alias
     * @param description
     */
    private DriverAuditStatus(String alias, String description) {
        this.alias = alias;
        this.description = description;
    }

    /**
     * @param alias
     * @return
     */
    public static DriverAuditStatus aliasOf(String alias) {
        
        for (DriverAuditStatus driverAuditStatus : DriverAuditStatus.values()) {
            if (driverAuditStatus.getAlias().equals(alias)) {
                return driverAuditStatus;
            }
        }
        
        return null;
    }
    
    /**
     * @return
     */
    public boolean isEditing() {
        return this.equals(EDITING);
    }
    
    /**
     * @return
     */
    public boolean isAudit() {
        return this.equals(AUDIT);
    }
    
    /**
     * @return
     */
    public boolean isRejected() {
        return this.equals(REJECTED);
    }
    
    /**
     * @return
     */
    public boolean isQualified() {
        return this.equals(QUALIFIED);
    }

    /**
     * @return alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

}